<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var strategies = {
            "S": function(salary) {
                return salary * 4;
            },
            "A": function(salary) {
                return salary * 3;
            },
            "B": function(salary) {
                return salary * 2;
            }
        };
        var calculateBonus = function(level, salary) {
            return strategies[level](salary);
        };
        console.log(calculateBonus('S', 20000)); // 输出：80000
        console.log(calculateBonus('A', 10000)); // 输出：30000
    </script>
</body>
</html>